home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / T9TWUQ (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.5 KB  |  43 lines

  1. package java.awt.event;
  2.  
  3. import java.awt.Component;
  4. import java.awt.Container;
  5.  
  6. public class ContainerEvent extends ComponentEvent {
  7.    public static final int CONTAINER_FIRST = 300;
  8.    public static final int CONTAINER_LAST = 301;
  9.    public static final int COMPONENT_ADDED = 300;
  10.    public static final int COMPONENT_REMOVED = 301;
  11.    Component child;
  12.    private static final long serialVersionUID = -4114942250539772041L;
  13.  
  14.    public ContainerEvent(Component source, int id, Component child) {
  15.       super(source, id);
  16.       this.child = child;
  17.    }
  18.  
  19.    public Component getChild() {
  20.       return this.child;
  21.    }
  22.  
  23.    public Container getContainer() {
  24.       return (Container)super.source;
  25.    }
  26.  
  27.    public String paramString() {
  28.       String typeStr;
  29.       switch (super.id) {
  30.          case 300:
  31.             typeStr = "COMPONENT_ADDED";
  32.             break;
  33.          case 301:
  34.             typeStr = "COMPONENT_REMOVED";
  35.             break;
  36.          default:
  37.             typeStr = "unknown type";
  38.       }
  39.  
  40.       return typeStr + ",child=" + this.child.getName();
  41.    }
  42. }
  43.